import request from '@/utils/request'

// 查询用户信息列表
export function listInfo(query) {
  return request({
    url: '/user/info/list',
    method: 'get',
    params: query
  })
}

// 删除用户信息
export function delInfo(userId) {
  return request({
    url: '/user/info/' + userId,
    method: 'delete'
  })
}

// 查询用户信息详细
export function getInfo(userId, entityId) {
  return request({
    url: '/user/info/' + userId,
    method: 'get',
    params: {entityId: entityId}
  })
}

// 用户状态修改
export function changeUserStatus(userId, status) {
  const data = {
    userId,
    status
  }
  return request({
    url: '/user/info/changeStatus',
    method: 'put',
    data: data
  })
}

// 生成临时密码
export function generateTempPwd(userId) {
  return request({
    url: '/user/info/generateTempPassword/' + userId,
    method: 'get'
  });
}
